package org.mat.ipaas.ucenter.service.api.system;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.mat.framework.lang.dto.MatApiResponse;
import org.mat.ipaas.ucenter.service.dto.system.entity.SysRoleIndexDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 角色首页配置
 */
@Api(tags = "角色首页配置")
@FeignClient(name = "mat-ipaas-ucenter-service",contextId = "sys-role-index-rest-api")
public interface SysRoleIndexRestAPI {

    /**
     * 分页列表查询
     *
     * @param sysRoleIndexDTO
     * @param pageNo
     * @param pageSize
     * @param req
     * @return
     */
    @ApiOperation(value = "角色首页配置-分页列表查询", notes = "角色首页配置-分页列表查询")
    @GetMapping(value = "/sys/sysRoleIndex/list")
    MatApiResponse<?> queryPageList(SysRoleIndexDTO sysRoleIndexDTO,
                                    @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                    @RequestParam HttpServletRequest req);

    /**
     * 添加
     *
     * @param sysRoleIndexDTO
     * @return
     */
    @ApiOperation(value = "角色首页配置-添加", notes = "角色首页配置-添加")
    @PostMapping(value = "/sys/sysRoleIndex/add")
    MatApiResponse<?> add(@RequestBody SysRoleIndexDTO sysRoleIndexDTO, @RequestParam HttpServletRequest request);

    /**
     * 编辑
     *
     * @param sysRoleIndexDTO
     * @return
     */
    @ApiOperation(value = "角色首页配置-编辑", notes = "角色首页配置-编辑")
    @RequestMapping(value = "/sys/sysRoleIndex/edit", method = {RequestMethod.POST})
    MatApiResponse<?> edit(@RequestBody SysRoleIndexDTO sysRoleIndexDTO, @RequestParam HttpServletRequest request);

    /**
     * 通过id删除
     *
     * @param id
     * @return
     */
    @ApiOperation(value = "角色首页配置-通过id删除", notes = "角色首页配置-通过id删除")
    @DeleteMapping(value = "/sys/sysRoleIndex/delete")
    MatApiResponse<?> delete(@RequestParam(name = "id", required = true) String id);

    /**
     * 批量删除
     *
     * @param ids
     * @return
     */
    @ApiOperation(value = "角色首页配置-批量删除", notes = "角色首页配置-批量删除")
    @DeleteMapping(value = "/sys/sysRoleIndex/deleteBatch")
    MatApiResponse<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids);

    /**
     * 通过id查询
     *
     * @param id
     * @return
     */
    @ApiOperation(value = "角色首页配置-通过id查询", notes = "角色首页配置-通过id查询")
    @GetMapping(value = "/sys/sysRoleIndex/queryById")
    MatApiResponse<?> queryById(@RequestParam(name = "id", required = true) String id);

    /**
     * 导出excel
     *
     * 
     * @param sysRoleIndexDTO
     */
    @RequestMapping(value = "/sys/sysRoleIndex/exportXls")
    ModelAndView exportXls( SysRoleIndexDTO sysRoleIndexDTO);

    /**
     * 通过excel导入数据
     *
     * 
     * 
     * @return
     */
    @RequestMapping(value = "/sys/sysRoleIndex/importExcel", method = RequestMethod.POST)
    MatApiResponse<?> importExcel( );

    /**
     * 通过code查询
     *
     * @param roleCode
     * @return
     */
    @ApiOperation(value = "角色首页配置-通过code查询", notes = "角色首页配置-通过code查询")
    @GetMapping(value = "/sys/sysRoleIndex/queryByCode")
    MatApiResponse<?> queryByCode(@RequestParam(name = "roleCode", required = true) String roleCode, @RequestParam HttpServletRequest request);
}
